import request from '@/utils/request'
// PATCH /api/supplier_settlement_details
// 导入结算总表

// POST /api/supplier_settlement_details
// 根据课程供应商主键ID生成结算清单

// DELETE /api/supplier_settlement_details/{id}
// 根据主键ID删除单条记录
export function delSettlement(id) {
  return request({
    url: `/api/supplier_settlement_details/${id}`,
    method: 'delete'
  })
}
// 获取总单详情
export function getWarehouseById(id) {
  return request({
    url: `/api/supplier_warehouse_receipts/${id}`,
    method: 'get'
  })
}
// PUT /api/supplier_settlement_details
// 根据主键ID更新记录
export function updatEsettlement(data) {
  return request({
    url: '/api/supplier_settlement_details',
    method: 'put',
    data
  })
}
// GET /api/supplier_settlement_details/settlement_list
// 供应商结算总表
export function suppliersList(query) {
  return request({
    url: '/api/supplier_settlement_details/settlement_list',
    method: 'get',
    params: query
  })
}

export function addSupplierWare(data) {
  return request({
    url: '/api/supplier_warehouse_receipts',
    method: 'post',
    data
  })
}

// /api/supplier_warehouse_receipts/{id}  根据入库删除
export function delWarehouse(id) {
  return request({
    url: `/api/supplier_warehouse_receipts/${id}`,
    method: 'delete'
  })
}
// /api/supplier_warehouse_receipts 入库课程纵览
export function wareHouseList(query) {
  return request({
    url: '/api/supplier_warehouse_receipts',
    method: 'get',
    params: query
  })
}

export function generateSettlement(data) {
  return request({
    url: '/api/supplier_settlement_details/sssdetialByPoCourseSupplierId4Export',
    method: 'post',
    data
  })
}

export function updateSettleState(data) {
  return request({
    url: '/api/supplier_settlement_details/updateStateByIds4Export',
    method: 'post',
    data
  })
}
